package com.example.ttkl.fragment.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.ttkl.Base.BaseRecAdapter;
import com.example.ttkl.R;
import com.example.ttkl.fragment.bean.ImageTextBean;

import java.util.List;

public class XGJRelAdapter extends BaseRecAdapter {
    public XGJRelAdapter(Context context, List data) {
        super(context, data);
    }

    @Override
    protected int getLayout() {
        return R.layout.item_xgj;
    }

    @Override
    protected void bindData(BaseViewHolder viewHolder, Object o) {
        ImageView mIv = (ImageView) viewHolder.getViewById(R.id.iv_item);
        TextView mTv = (TextView) viewHolder.getViewById(R.id.tv_item);

        ImageTextBean bean = (ImageTextBean) o;
        mIv.setImageDrawable(context.getResources().getDrawable(bean.getImage()));
        mTv.setText(bean.getName());
    }
}
